package com.lzy.okgo.interceptor;


import android.text.TextUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * author : dengguangzhong
 * e-mail : 290032046@qq.com
 * time   : 2020/12/23
 * desc   :
 */
public class UInterceptor implements Interceptor {
    public static String lon = "";    //经度
    public static String lat = "";    //维度
    public static String TOKEN = "2znV8TN@mvgrPofWGmqYtjTNsv4oEFsP";

    public UInterceptor() {

    }


    @Override
    public Response intercept(Chain chain) throws IOException {
        //TODO 待优化
        Request.Builder builder = chain.request()
                .newBuilder();
        if (!TextUtils.isEmpty(TOKEN)) {
            builder.header("token", TOKEN);
        }
        //请求信息
        return chain.proceed(builder.build());
    }
}